package com.zhong.gang.applib.utils;

import android.app.Activity;
import android.content.Intent;
import android.os.Build;

import androidx.annotation.NonNull;

import com.uuzuche.lib_zxing.activity.CaptureActivity;
import com.zhong.gang.applib.utils.permission.PermissionCallback;
import com.zhong.gang.applib.utils.permission.PermissionCamera;
import java.util.List;

public class ScanUtils {
    public static final void openScan(Activity activity,int code){
        new PermissionCamera(activity, new PermissionCallback(activity) {
            @Override
            public void onSucceed(int requestCode, @NonNull List<String> grantPermissions) {
                activity.startActivityForResult(new Intent(activity, CaptureActivity.class), code);
            }
        });
    }
}
